<?php

/**
 * @copyright : ienter asia Technologies
 * @author :  Hunglv
 * @version    1.0
 * @Description : Upload CSV file and save data to session 
 */
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Mod_upload extends MYAD_Controller {
    /**
     * function __construct
     * not overloading parent __construct
     */    
    function __construct() {
        parent::__construct();
        $this->load->model('Mmod_upload');
    }
    /**
     * Review data uploaded form CSV file
     * @return table review data uploaded
     */
    function index() {
        $temp = array();
        if (isset($_FILES['fileupload']) && !empty($_FILES['fileupload'])) {
            $temp = $this->Mmod_upload->uploadCSV();
        }
        $infoUpload = $this->Mmod_upload->getInfoUpload();
        $data =  array_merge($temp,$infoUpload);
        $this->load->view('layout', $data);
    }
}

?>